/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50728
 Source Host           : localhost:3306
 Source Schema         : life_system_admin

 Target Server Type    : MySQL
 Target Server Version : 50728
 File Encoding         : 65001

 Date: 14/04/2024 14:58:41
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_auth_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_auth_permission`;
CREATE TABLE `sys_auth_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '权限ID',
  `name` varchar(50) DEFAULT NULL,
  `description` varchar(200) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `order` int(11) DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `is_deleted` int(11) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `remarks` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='权限表';

-- ----------------------------
-- Records of sys_auth_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (1, '表格', '表格看板', '/table', '/table', 0, 0, 'menu', 1, 0, '2024-03-11 15:30:45', '2024-04-03 18:38:24', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (2, 'element-plus', 'element-plus', '/table/element-plus', '/table/element-plus/index', 1, 1, 'menu', 1, 0, '2024-03-11 16:49:44', '2024-04-03 18:27:10', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (3, 'vxe-table', 'vxe-table', '/table/vxe-table', '/table/vxe-table/index', 1, 0, 'menu', 1, 0, '2024-03-11 16:50:32', '2024-04-03 18:27:13', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (4, '系统管理', '系统管理-菜单', '/system', '/system', 0, 0, 'menu', 1, 0, '2024-03-29 16:08:22', '2024-04-03 18:27:14', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (5, '权限管理', '权限管理-菜单', '/system/permission', '/system/permission', 4, 1, 'menu', 1, 0, '2024-03-29 16:09:07', '2024-04-03 18:27:15', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (6, '用户列表', '用户列表-菜单', '/system/permission/user', '/system/permission/user', 5, 1, 'menu', 1, 0, '2024-03-29 16:09:10', '2024-04-03 18:27:16', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (7, '角色列表', '角色列表-菜单', '/system/permission/role', '/system/permission/role', 5, 1, 'menu', 1, 0, '2024-03-29 16:10:34', '2024-04-03 18:27:17', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (8, '权限列表', '权限列表-菜单', '/system/permission/permission', '/system/permission/permission', 5, 1, 'menu', 1, 0, '2024-03-29 16:10:54', '2024-04-03 18:27:18', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (9, '应用管理', '应用管理-菜单', '/system/app', '/system/app', 0, 1, 'menu', 1, 0, '2024-04-03 17:56:53', '2024-04-03 18:27:19', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (10, '微信小程序', '微信小程序-菜单', '/system/app/minipro', '/system/app/minipro', 9, 1, 'menu', 1, 0, '2024-04-03 17:57:25', '2024-04-03 18:27:20', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (11, 'APP', 'APP-菜单', '/system/app/app', '/system/app/app', 9, 1, 'menu', 1, 0, '2024-04-03 17:57:46', '2024-04-03 18:27:22', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (12, '查询用户', '查询用户列表', 'sys::user::list', 'sys::user::list', 7, 1, NULL, 2, 0, '2024-04-09 11:30:30', '2024-04-09 11:32:00', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (13, '添加用户', '添加用户', 'sys::user::add', 'sys::user::add', 7, 2, NULL, 2, 0, '2024-04-09 11:32:46', '2024-04-09 11:32:46', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (14, '删除用户', '删除用户', 'sys::user::delete', 'sys::user::delete', 7, 3, NULL, 2, 0, '2024-04-09 11:33:11', '2024-04-09 11:33:25', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (15, '封禁用户', '封禁用户', 'sys::user::ban', 'sys::user::ban', 7, 4, NULL, 2, 0, '2024-04-09 11:33:45', '2024-04-09 11:34:09', NULL);
INSERT INTO `sys_auth_permission` (`id`, `name`, `description`, `path`, `url`, `parent_id`, `order`, `icon`, `type`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (16, '角色列表', '角色列表', 'sys::role::list', 'sys::role::list', 7, 5, NULL, 2, 0, '2024-04-14 13:09:49', '2024-04-14 13:09:49', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_auth_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_auth_role`;
CREATE TABLE `sys_auth_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `name` varchar(50) DEFAULT NULL,
  `is_deleted` tinyint(4) DEFAULT '0',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `remarks` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='角色表';

-- ----------------------------
-- Records of sys_auth_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_auth_role` (`id`, `name`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (1, '访客', 0, '2024-03-11 15:32:03', '2024-03-11 15:32:03', NULL);
INSERT INTO `sys_auth_role` (`id`, `name`, `is_deleted`, `create_time`, `update_time`, `remarks`) VALUES (2, '超管', 0, '2024-03-11 16:49:05', '2024-03-11 16:49:05', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_auth_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_auth_role_permission`;
CREATE TABLE `sys_auth_role_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `role_id` int(11) DEFAULT NULL,
  `permission_Id` int(11) DEFAULT NULL,
  `is_deleted` tinyint(4) DEFAULT '0',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表';

-- ----------------------------
-- Records of sys_auth_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (1, 1, 1, 0, '2024-03-11 15:32:12', '2024-03-11 15:32:12');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (2, 2, 1, 0, '2024-03-11 16:49:16', '2024-03-11 16:49:16');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (3, 2, 2, 0, '2024-03-11 16:50:50', '2024-03-11 16:50:50');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (4, 2, 3, 0, '2024-03-11 16:50:56', '2024-03-11 16:50:56');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (5, 2, 4, 0, '2024-03-29 16:14:01', '2024-03-29 16:14:01');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (6, 2, 5, 0, '2024-03-29 16:14:08', '2024-03-29 16:14:08');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (7, 2, 6, 0, '2024-03-29 16:14:12', '2024-03-29 16:14:12');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (8, 2, 7, 0, '2024-03-29 16:14:16', '2024-03-29 16:14:16');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (9, 2, 8, 0, '2024-03-29 16:14:20', '2024-03-29 16:14:20');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (10, 2, 9, 0, '2024-04-03 17:58:06', '2024-04-03 17:58:06');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (11, 2, 10, 0, '2024-04-03 17:58:09', '2024-04-03 17:58:09');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (12, 2, 11, 0, '2024-04-03 17:58:13', '2024-04-03 17:58:13');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (13, 2, 12, 0, '2024-04-09 11:31:38', '2024-04-09 11:31:38');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (14, 2, 13, 0, '2024-04-14 13:10:17', '2024-04-14 13:10:17');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (15, 2, 14, 0, '2024-04-14 13:12:19', '2024-04-14 13:12:19');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (16, 2, 15, 0, '2024-04-14 13:12:23', '2024-04-14 13:12:23');
INSERT INTO `sys_auth_role_permission` (`id`, `role_id`, `permission_Id`, `is_deleted`, `create_time`, `update_time`) VALUES (17, 2, 16, 0, '2024-04-14 13:12:32', '2024-04-14 13:12:32');
COMMIT;

-- ----------------------------
-- Table structure for sys_auth_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_auth_user`;
CREATE TABLE `sys_auth_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` varchar(50) NOT NULL COMMENT '用户名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `nickname` varchar(50) DEFAULT NULL COMMENT '昵称',
  `country_code` varchar(10) DEFAULT NULL COMMENT '国家代码',
  `region_code` varchar(20) DEFAULT NULL COMMENT '地区代码',
  `gender` tinyint(1) DEFAULT NULL COMMENT '性别, 1:男性, 0:女性',
  `birth_date` date DEFAULT NULL COMMENT '出生日期',
  `email` varchar(255) DEFAULT NULL COMMENT '邮箱',
  `phone_number` varchar(20) DEFAULT NULL COMMENT '电话号码',
  `avatar_url` varchar(255) DEFAULT NULL COMMENT '头像URL',
  `last_login_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后一次登录时间',
  `registration_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间',
  `is_deleted` tinyint(4) DEFAULT '0',
  `is_ban` tinyint(4) DEFAULT '0' COMMENT '是否封禁',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `remarks` text,
  PRIMARY KEY (`id`),
  KEY `idx_email` (`email`),
  KEY `idx_phone_number` (`phone_number`),
  KEY `idx_create_time` (`create_time`),
  KEY `idx_update_time` (`update_time`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='用户表';

-- ----------------------------
-- Records of sys_auth_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_auth_user` (`id`, `username`, `password`, `nickname`, `country_code`, `region_code`, `gender`, `birth_date`, `email`, `phone_number`, `avatar_url`, `last_login_time`, `registration_time`, `is_deleted`, `is_ban`, `create_time`, `update_time`, `remarks`) VALUES (3, 'GWG', '$2a$10$1GH4JmVrGvyEzlEFW.dn/edNDtVazJ9cS4Wt/Qo8XRFcLo9Inxh1u', 'GWG', NULL, NULL, NULL, NULL, 'gerylove5927@qq.com', '13611077106', NULL, '2024-04-14 12:05:14', '2024-01-18 15:36:01', 0, 0, '2024-01-18 15:36:01', '2024-04-14 12:05:14', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_auth_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_auth_user_role`;
CREATE TABLE `sys_auth_user_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `user_id` int(11) DEFAULT NULL,
  `role_id` int(11) DEFAULT NULL,
  `is_deleted` tinyint(4) DEFAULT '0',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户角色关联表';

-- ----------------------------
-- Records of sys_auth_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_auth_user_role` (`id`, `user_id`, `role_id`, `is_deleted`, `create_time`, `update_time`) VALUES (1, 3, 1, 0, '2024-03-11 15:32:28', '2024-03-11 15:32:28');
INSERT INTO `sys_auth_user_role` (`id`, `user_id`, `role_id`, `is_deleted`, `create_time`, `update_time`) VALUES (2, 3, 2, 0, '2024-03-19 18:43:53', '2024-04-03 18:17:18');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;

-- ----------------------------
-- 应用详情表
-- ----------------------------
CREATE TABLE `sys_app_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `app_id` varchar(6) NOT NULL COMMENT '应用ID',
	`app_name` varchar(50) DEFAULT NULL COMMENT '应用名称',
  `app_desc` varchar(200) DEFAULT NULL COMMENT '应用描述',
  `app_type` int(4) DEFAULT NULL COMMENT '应用类型,1:APP,2:WeChat',
  `is_deleted` int(11) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `remarks` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='应用管理表';
